class EdtNotification extends window.Notification {
    static permission = "granted";
    constructor(title, options) {
        // super(title, options);
        window.EdtUtils?.EdtNotify(title, options);
    }
    static requestPermission = (cb = null) => {
        if (!cb) return new Promise((resolve) => {
            resolve(EdtNotification.permission);
        });
        if ('function' == typeof cb) return cb(EdtNotification.permission);
        return EdtNotification.permission;
    }
}
window.Notification = EdtNotification;
(function () {
    function initAudioManager() {
        let notifySound = document.getElementById("notify-sound");
        let audioBox = notifySound?.previousElementSibling//查找上一个兄弟节点
        if (!audioBox) {
            setTimeout(() => {
                initAudioManager();
            }, 500);
            return;
        }
        let observer = new MutationObserver(() => {
            setTimeout(() => {
                let medias = window.appMediaPlaybackController.media;
                for (let [peeId, audios] of medias) {
                    for (let [mid, audio] of audios) {
                        if (audio.getAttribute("src") && !audio.getAttribute("id")) {
                            audio.setAttribute("id", `audio-${peeId}-${mid}`);
                        }
                    }
                }
            }, 1500);
        });
        observer.observe(audioBox, {
            childList: true,
        });
        console.log("初始化语音文件匹配完成");
    }
    initAudioManager();
}())
